#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
const ll mod = 1e9 + 7;
const int maxn = 2e9 + 30;
ll f[3] = {1, 1};//滚动数组

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n;
    while (cin >> n) {
        for (int i = 2; i <= n; i++) {
            f[i % 3] = (f[(i + 2) % 3] + f[(i + 1) % 3]) % mod;
        }
        cout << f[n % 3] << endl;
    }
    return 0;
}
